//
//  UIImageView+SDImgView.h
//  DoulinClient
//
//  Created by YLKJ on 2019/1/22.
//

#import <UIKit/UIKit.h>

@interface UIImageView (SDImgView)

@property NSString * imgURL;
@property NSString * imgThumbURL;

/** 压缩头像图片
 * url: NSString/NSUrl 对象
 * phImg: 占位图 默认:kIconPH
 * size: 目标尺寸(单倍图宽高)(根据size的长宽最小值将图片等比压缩) 默认:CGSizeMake(50, 50)
 */
- (void)yl_setIconWithUrl:(id)url;
- (void)yl_setIconWithUrl:(id)url size:(CGSize)size;
- (void)yl_setIconWithUrl:(id)url phImg:(UIImage *)phImg;
- (void)yl_setIconWithUrl:(id)url phImg:(UIImage *)phImg size:(CGSize)size;

/** 压缩图片
 * url: NSString/NSUrl 对象
 * phImg: 占位图 默认:kImgPH
 * size: 目标尺寸(单倍图宽高)(根据size的长宽最小值将图片等比压缩)
 */
- (void)yl_setImgWithURL:(id)url size:(CGSize)size;
- (void)yl_setImgWithURL:(id)url phImg:(UIImage *)phImg size:(CGSize)size;

/** 压缩正方形图片:(已知:所有商品图片/小区店铺icon)
 * url: NSString/NSUrl 对象
 * phImg: 占位图 默认:kImgPH
 * wh: 目标尺寸宽高(单倍图宽高)
 */
- (void)yl_setSquareImgWithURL:(id)url wh:(CGFloat)wh;
- (void)yl_setSquareImgWithURL:(id)url phImg:(UIImage *)phImg wh:(CGFloat)wh;


- (void)addTarget:(id)target action:(SEL)action;

@end
